<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="Responsive Web UI Kit &amp; Dashboard Template based on Bootstrap">
    <meta name="author" content="AdminKit">
    <meta name="keywords" content="adminkit, bootstrap, web ui kit, dashboard template, admin template">
    <link rel="shortcut icon" href="${pageContext.request.contextPath}/img/icons/icon-48x48.png"/>
    <link href="${pageContext.request.contextPath}/css/app.css" rel="stylesheet">
</head>

<body>
<div class="wrapper">
    <%@include file="../icn/sidebar.jsp" %>
    <div class="main">
        <%@include file="../icn/head.jsp" %>
        <main>
            <div class="row" >
                <div class="col-lg-12">
                    <div class="panel panel-default wk-panel wk-table-tools-panel">
                        <div class="panel-heading" style="font-size: 20px;text-align: center;padding-top: 20px;font-weight: bold;color: #0b7ec4" >
                            热门事项分组
                        </div>
                        <div class="panel-body">
                            <div style="display:inline;width:50%">
                                <form style="display:inline-block;margin-top:30px;" action="${pageContext.request.contextPath}/system/item/item_group" method="get">
                                    <span style="margin-left:50px;">在线状态</span>
                                    <select  name="status" style="height:30px;width:200px"  >
                                        <option value="">全部</option>
                                        <option value="1">上线</option>
                                        <option value="0">下线</option>
                                    </select>
                                    <button type="submit" style="margin-left:30px" class="btn btn-success" ><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-filter align-middle mr-2"><polygon points="22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"></polygon></svg> 查询</button>
                                </form>
                            </div>
                            <div style="display:inline;width:50%">
                                <form style="display:inline-block;margin-top:30px;" action="${pageContext.request.contextPath}/system/item/item_group" method="get">
                                    <span style="margin-left:50px;">分组名称</span>
                                    <input name="name" type="text" placeholder="模糊查询">
                                    <button type="submit" style="margin-left:30px" class="btn btn-success" ><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-filter align-middle mr-2"><polygon points="22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"></polygon></svg> 查询</button>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row" style="padding: 0px 0px 0px 50px">
                <div class="col-lg-12">
                    <div class="panel panel-default  wk-panel">
                        <div>
                            <a style="margin: 20px 0 10px 50px"  class="btn btn-success" href="item_group/insert">新增</a>
                        </div>
                        <table class="table table-striped table-hover" style="text-align: center">
                            <thead>
                            <tr>
<%--                                <th>选择</th>--%>
                                <th>分组名称</th>
                                <th>图标</th>
                                <th>创建时间</th>
                                <th>修改时间</th>
                                <th>事项数量</th>
                                <th>在线状态</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <c:forEach items="${group.list}" var="var">
                                <tr>
<%--                                    <td><input id="grid_${var.id}" name="workerRadio" type="radio" aria-label="选择"/></td>--%>
                                    <td>${var.name}</td>
                                    <td><img src="${var.icon}" style="width: 20px"></td>
                                    <td><fmt:formatDate value="${var.createTime}" pattern="yyyy-MM-dd"/></td>
                                    <td><fmt:formatDate value="${var.updateTime}" pattern="yyyy-MM-dd"/></td>
                                    <td>${var.itemCount}</td>
                                    <c:choose>
                                        <c:when test="${var.status=='1'}">
                                            <td id="OBTAINRESULT">上线</td>
                                        </c:when>
                                        <c:when test="${var.status=='0'}">
                                            <td id="OBTAINRESULT">下线</td>
                                        </c:when>
                                    </c:choose>
                                    <td class="table-action">
                                        <a href="${pageContext.request.contextPath}/system/item/item_material/group_change/${var.id}"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-edit-2 align-middle"><path d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"></path></svg></a>
                                        <a href="${pageContext.request.contextPath}/system/item/item_material/del/${var.id}"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-trash align-middle"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path></svg></a>
                                    </td>
                                </tr>
                            </c:forEach>
                            </tbody>
                        </table>
                        <ul class="pagination pg-primary" style="margin-left: 10px">
                            <c:if test="${group.page!=1}">
                                <li class="page-group">
                                    <a class="page-link" href="?page=${group.page-1}" aria-label="Previous">
                                        <span aria-hidden="true">&laquo;</span>
                                        <span class="sr-only">Previous</span>
                                    </a>
                                </li>
                            </c:if>

                            <c:forEach begin="1" end="${group.pageSize}" var="i">
                                <li class="page-group ${group.page==i?'active':''}">
                                    <a class="page-link" href="?page=${i}" style="border-radius: 13px">${i}</a></li>
                            </c:forEach>

                            <c:if test="${group.page!=group.pageSize}">
                                <li class="page-group">
                                    <a class="page-link" href="?page=${group.page+1}" aria-label="Next">
                                        <span aria-hidden="true">&raquo;</span>
                                        <span class="sr-only">Next</span>
                                    </a>
                                </li>
                            </c:if>
                            <span style="    position: relative;
                                        top: 2px;
                                        left: 20px;
                                        font-size: 17px">
                                        共：${group.count}条
                            </span>
                        </ul>
                    </div>
                </div>
            </div>
        </main>
    </div>
</div>
<script src="${pageContext.request.contextPath}/js/vendor.js"></script>
<script src="${pageContext.request.contextPath}/js/app.js"></script>
</body>
</html>
